Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[common] Introduce BitmapFileIndexMetaV2. #5028

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

hang8929201
Copy link
Contributor

Purpose

When the bitmap-indexed column cardinality is high, using the first version of the bitmap index format will take a lot of time to read the entire dictionary. But in fact we don't need a full dictionary when dealing with a small number of predicates, the performance of predicate hits on the bitmap can be improved by creating a secondary index on the dictionary.

https://docs.google.com/document/d/11dJlGlSX3dwYKKrPN0DQ2XQTsx6d9wI6DTBIiiBwomM/edit?tab=t.0

performance

cardinality 1000:
image

cardinality 10000:
image

cardinality 30000:
image

cardinality 50000:
image

cardinality 80000:
image

cardinality 100000:
image

Tests

org.apache.paimon.fileindex.bitmapindex.TestBitmapFileIndex
org.apache.paimon.spark.SparkFileIndexITCase
org.apache.paimon.benchmark.bitmap.BitmapIndexBenchmark

API and Format

Documentation

docs/content/concepts/spec/fileindex.md

Copy link
Contributor

@Tan-JiaLiang Tan-JiaLiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hang8929201 Thanks for your patience!

+1 cc @JingsongLi

@2k124
Copy link

2k124 commented Feb 8, 2025

+1

@hang8929201
Copy link
Contributor Author

I found another question that needs to be discussed. Should the index version default to v1 or v2? @Tan-JiaLiang @JingsongLi

@JingsongLi
Copy link
Contributor

I found another question that needs to be discussed. Should the index version default to v1 or v2? @Tan-JiaLiang @JingsongLi

I don't have a clear idea, although it may cause compatibility issues, bitmap should not be used too much. Maintaining the default version to 1 is a relatively conservative choice.

* | ... |
* +-------------------------------------------------+-----------------
*
* index block format:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have ability to compress index block?

Options options;

void tryDeserialize() {
if (entryList == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can take a look to https://cwiki.apache.org/confluence/display/PAIMON/PIP-25%3A+Introduce+a+key-value+file+format+for+paimon+primary+key+table

Here just something like LevelDB sst block, we can store length to avoid deserialize all entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants